Top 10k strings from Linegame (1986)(Salmi, Timo).bas
in <root> / bin / z80 / software / Sinclair Spectrum Collection TOSEC.exe / Sinclair ZX-81 & Sinclair QL - Various / Sinclair QL - Various (TOSEC-v2006-04-09) /
Back to the directory listing
1 990 LINE 0,-origo_y% TO 0,102-origo_y% 1 980 LINE -origo_x%,0 TO 102-origo_x%,0 1 970 LOCal i:INK 5 1 960 DEFine PROCedure p_akselit 1 930 FOR i=3 TO 7:CLOSE#i:END FOR i 1 900 END REPeat runko 1 880 IF f_vielako:NEXT runko:ELSE :EXIT runko:END IF 1 860 END IF 1 850 paras%=pisteet% 1 840 PRINT#4,pisteet%:FLASH#4,0 1 830 AT#4,0,9-LEN(pisteet%):INK#4,6 1 820 IF paras%>0 THEN FLASH#4,1 1 810 IF pisteet%>paras% THEN 1 790 END REPeat loop 1 780 END IF 1 770 CLS#6:CSIZE#6,2,0 1 760 CLS:p_akselit:p_piirra_ympyrat 1 750 p_odota_alku:p_arvonta:p_odota_loppu 1 740 max_kierros%=max_kierros%+1 1 730 p_bonus_ilmoitus 1 720 FOR i=1 TO n%:osuma%(i)=0:END FOR i 1 710 IF (kierros%=3 AND pisteet%>=43) OR (kierros%>3 AND lisapisteet%>=10+2*kierros%) THEN 1 700 IF pisteet%>950 THEN EXIT loop 1 690 AT#4,0,9-LEN(pisteet%):INK#4,6:PRINT#4,pisteet% 1 680 p_suora(a),(k) 1 670 END FOR i 1 660 END IF 1 650 END IF 1 640 p_ympyra(kx%(i)),(ky%(i)),(sade%(i)),(arvo%(i)),(1) 1 630 pisteet%=pisteet%+arvo%(i) 1 620 lisapisteet%=lisapisteet%+arvo%(i) 1 610 p_beep2:osuma%(i)=1 1 600 IF ero<=sade%(i) THEN 1 590 ero=f_etaisyys((kx%(i)),(ky%(i)),(a),(k)) 1 580 IF osuma%(i)=0 THEN 1 570 FOR i=1 TO n% 1 560 lisapisteet%=0 1 550 CURSOR#5,140-12*LEN(kulma),0:PRINT#5,kulma;"" 1 540 kulma=INT(180*ATAN(k)/PI+.5):AT#5,0,8:CLS#5,4 1 530 k=f_kysyluku(("k? "),("-10000"),(" 10000")) 1 520 a=f_kysyluku(("a? "),("-10000"),(" 10000")) 1 510 AT#3,0,8:PRINT#3,kierros% 1 500 IF kierros%>max_kierros% THEN EXIT loop 1 490 kierros%=kierros%+1 1 480 REPeat loop 1 470 kierros%=0 1 460 pisteet%=0 1 430 p_piirra_ympyrat 1 420 p_arvonta:p_odota_loppu 1 410 p_odota_alku 1 390 SCALE 100,-origo_x%,-origo_y%:p_akselit 1 3710 END DEFine vsave 1 3700 PRINT#0,"Saved"!bvl$!"version"!ver1%;".";ver% 1 3690 LIST#3,32130 TO:CLOSE#3 1 3680 PRINT#3,"32120 ver1%=";ver1%;":ver2%=";ver% 1 3670 LIST#3,100 TO 32110 1 3660 PRINT#3,"4 :" 1 3650 PRINT#3,"3 REMark version"!ver1%;".";ver% 1 3640 PRINT#3,"2 REMark ";DAY$!DATE$ 1 3630 PRINT#3,"1 REMark ";avl$!"(c) Timo Salmi" 1 3620 DELETE bvl$:OPEN_NEW#3,bvl$:ver%=ver2%+1 1 3610 bvl$=dvl$(dr)&avl$ 1 3600 dvl$(5)="ram1_":dvl$(6)="ram2_" 1 360 p_kyselyikkuna 1 3590 dvl$(3)="fdk1_":dvl$(4)="fdk2_" 1 3580 dvl$(1)="mdv1_":dvl$(2)="mdv2_" 1 3570 ver1%=1:ver2%=-1 1 3560 BEEP 4000,12:STOP:END IF 1 3550 PRINT#0,DAY$!DATE$!"Not saved, set SDATE" 1 3540 IF bvl$<>1992 THEN 1 3530 bvl$=DATE$:bvl$=bvl$(1 TO 4) 1 3520 LOCal avl$(42),bvl$(42),dvl$(6,5):avl$="linegame" 1 3510 DEFine PROCedure vsave(dr) 1 3500 vsave 6:STOP 1 350 p_tangenttikkuna 1 3490 vsave 5:STOP 1 3480 vsave 4:STOP 1 3470 vsave 3:STOP 1 3460 vsave 2:STOP 1 3450 vsave 1:STOP 1 3420 END DEFine reset 1 3410 SCALE 100,0,0:FILL 0 1 3400 PAPER#0,0:INK#0,7-3*(i=0):INK 7:CLS 1 340 p_huippu_pisteikkuna 1 3390 FOR il=0,1,2:CSIZE#il,(i=4)+2*(i=8),0:END FOR il 1 3380 PAPER 2*(i=8):BORDER (i=4),4*(i=4) 1 3370 WINDOW 448+8*(i=4),200+2*(i=4),32-4*(i=4),16-(i=4) 1 3360 WINDOW#2,448,200,32,16:PAPER#2,1:INK#2,7 1 3350 WINDOW#0,448,40-(i=4),32,216+(i=4) 1 3340 WINDOW 512,256,0,0:PAPER 0:CLS 1 3330 FOR il=1,2:OPEN#il,con_:END FOR il 1 3320 LOCal il:MODE i 1 3310 DEFine PROCedure reset(i) 1 330 p_pisteikkuna 1 3290 END DEFine f_vielako 1 3280 RETurn key%=240 1 3270 END REPeat loop 1 3260 IF key%= 27 THEN EXIT loop 1 3250 IF key%=240 THEN EXIT loop 1 3240 key%=CODE(INKEY$(-1)) 1 3230 REPeat loop 1 3220 clb=KEYROW(0) 1 3210 CURSOR#cl%,20,50:PRINT#cl%,"QUIT: ESC"; 1 3200 CURSOR#cl%,20,40:PRINT#cl%,"AGAIN: F3" 1 320 p_kierrosikkuna 1 3190 CSIZE#cl%,2,0 1 3180 CURSOR#cl%,8,10:PRINT#cl%,"GAME OVER" 1 3170 PAPER#cl%,0:CLS#cl%:INK#cl%,5:CSIZE#cl%,3,1 1 3160 LOCal key%,cl%,loop:cl%=6 1 3150 DEFine FuNction f_vielako 1 3130 END DEFine f_kysyluku 1 3120 END REPeat kysy 1 3110 RETurn lukul 1 3100 END IF 1 310 p_arvot_vakioikkuna 1 3090 NEXT kysy 1 3080 PRINT#cl%,"MIN"!ala$:PRINT#cl%,"MAX"!yla$ 1 3070 INK#cl%,2:p_beep1 1 3060 IF lukul<ala$ OR lukul>yla$ THEN 1 3050 IF NOT ok:p_beep1:NEXT kysy:END IF 1 3040 lukul=f_digval((vl$)) 1 3030 clb%=KEYROW(0):INPUT#cl%,vl$ 1 3020 INK#cl%,5:PRINT#cl%,mj$; 1 3010 REPeat kysy 1 3000 LOCal kysy,lukul,ok,cl%,vl$(mp):cl%=6 1 300 p_sovita_vakioikkuna 1 3 REMark version 1.0 1 2990 DEFine FuNction f_kysyluku(mj$,ala$,yla$) 1 2970 END DEFine f_digval 1 2960 IF pl%>1:RETurn 0:END IF :ok=1:RETurn mj$ 1 2950 END FOR il 1 2940 IF mj$(il)="-" OR mj$(il)="+" THEN pl%=il 1 2930 FOR il=1 TO ml% 1 2920 IF pl%>1:RETurn 0:END IF :pl%=0 1 2910 IF mj$(il)=".":pl%=pl%+1:END IF :END FOR il 1 2900 FOR il=1 TO ml% 1 290 p_perusikkunat:levg3%=166 1 2890 IF nrl=0 THEN RETurn 0 1 2880 IF sl$(il)INSTR mj$>0:nrl=1:END IF :END FOR il 1 2870 FOR il=1 TO 10 1 2860 END FOR il 1 2850 IF mj$(il)INSTR sl$=0 THEN RETurn 0 1 2840 FOR il=1 TO ml% 1 2830 IF ml%=0 THEN RETurn 0 1 2820 ok=0:sl$="1234567890-+.":ml%=LEN(mj$) 1 2810 LOCal sl$(13),il,nrl,pl%,ml%:nrl=0:pl%=0 1 2800 DEFine FuNction f_digval(mj$) 1 2780 END DEFine p_nimio 1 2770 p_otsake_teksti(6):CLOSE#3 1 2760 END FOR i 1 2750 OVER#3,1:SCROLL#3,1:PAN#3,1.5 1 2740 p_otsake_teksti(1) 1 2730 FOR i=1 TO 2 1 2720 LOCal i:p_tausta 1 2710 DEFine PROCedure p_nimio 1 2690 END DEFine p_otsake_teksti 1 2680 INK#3,ik%:CURSOR#3,il2%,0:PRINT#3,tpvm$ 1 2670 FOR i=1 TO 10:READ il%:PRINT#3,CHR$(il%);:END FOR i 1 2660 DATA 84,105,109,111,32,83,97,108,109,105 1 2650 INK#3,ik%:CURSOR#3,il1%,0:RESTORE 2660 1 2640 il1%=(il2%+(4+4*il%)*LEN(ohj$)-35-40*il%)/2 1 2630 il2%=levg%-(4+4*il%)*LEN(tpvm$)-9 1 2620 CURSOR#3,5,0:INK#3,ik%:PRINT#3,ohj$ 1 2610 LOCal il1%,il2%,il%,i:il%=3 1 2600 DEFine PROCedure p_otsake_teksti(ik%) 1 260 max_kierros%=3 1 2580 END DEFine p_tausta 1 2570 PAPER#3,0:CLS#3:BORDER#3,2,1:CSIZE#3,3,1 1 2560 OPEN#3,con_:WINDOW#3,levg%,26,alkug%,230 1 2550 WINDOW 512,256,0,0:PAPER 2,1,3:CLS 1 2540 MODE 8:levg%=456:alkug%=INT((512-levg%)/2) 1 2530 DEFine PROCedure p_tausta 1 2510 END DEFine p_beep2 1 2500 IF bon THEN BEEP 500,12 1 250 vari%(5)=1:vari%(6)=5:origo_x%=1:origo_y%=1 1 2490 DEFine PROCedure p_beep2 1 2470 END DEFine p_beep1 1 2460 IF bon THEN BEEP 4000,70 1 2450 DEFine PROCedure p_beep1 1 2430 END DEFine f_mem 1 2420 RETurn PEEK_L(163856)-PEEK_L(163852) 1 2410 DEFine FuNction f_mem 1 240 vari%(1)=6:vari%(2)=2:vari%(3)=4:vari%(4)=3 1 2390 END DEFine p_kyselyikkuna 1 2380 PAPER#6,0:CSIZE#6,2,0:BORDER#6,2,1:INK#6,5:CLS#6 1 2370 OPEN#6,con_:WINDOW#6,levg3%,74,alkug%,142 1 2360 DEFine PROCedure p_kyselyikkuna 1 2340 END DEFine p_tangenttikkuna 1 2330 PRINT#5,":":OVER#5,0 1 2320 PRINT#5,"atan(k)":OVER#5,1:CURSOR#5,80,0 1 2310 PAPER#5,0:CSIZE#5,2,0:BORDER#5,2,1:INK#5,5:CLS#5 1 2300 OPEN#5,con_:WINDOW#5,levg3%,14,alkug%,115 1 230 DIM vari%(6) 1 2290 DEFine PROCedure p_tangenttikkuna 1 2270 END DEFine p_huippu_pisteikkuna 1 2260 AT#7,0,9-LEN(paras%):PRINT#7,paras% 1 2250 PRINT#7,"TOP :";:INK#7,2 1 2240 PAPER#7,0:CSIZE#7,3,1:BORDER#7,2,1:INK#7,5:CLS#7 1 2230 OPEN#7,con_:WINDOW#7,levg3%,24,alkug%,93 1 2220 DEFine PROCedure p_huippu_pisteikkuna 1 2200 END DEFine p_pisteikkuna 1 220 DIM osuma%(n%) 1 2190 PRINT#4,"SCORE: "; 1 2180 PAPER#4,0:CSIZE#4,3,1:BORDER#4,2,1:INK#4,5:CLS#4 1 2170 OPEN#4,con_:WINDOW#4,levg3%,24,alkug%,71 1 2160 DEFine PROCedure p_pisteikkuna 1 2140 END DEFine p_kierrosikkuna 1 2130 PRINT#3,"LINE :"; 1 2120 CSIZE#3,3,1:BORDER#3,2,1:INK#3,5:CLS#3 1 2110 WINDOW#3,levg3%,24,alkug%,49 1 2100 DEFine PROCedure p_kierrosikkuna 1 210 DIM arvo%(n%) 1 2080 END DEFine p_arvot_vakioikkuna 1 2070 END FOR i 1 2060 PRINT#3,i!; 1 2050 INK#3,vari%(i) 1 2040 FOR i=1 TO 6 1 2030 INK#3,5:PRINT#3,"SCORE VALUES:" 1 2020 PAPER#3,0:BORDER#3,2,1:CLS#3 1 2010 WINDOW#3,levg3%,24,alkug%,27 1 2000 LOCal i 1 200 DIM sade%(n%) 1 2 REMark Wed 1986 Dec 10 12:00:00 1 1990 DEFine PROCedure p_arvot_vakioikkuna 1 1970 END DEFine p_sovita_vakioikkuna 1 1960 PRINT#3,"FIT y=a+kx" 1 1950 BORDER#3,2,1:INK#3,5:CSIZE#3,2,0:CLS#3 1 1940 OPEN#3,con_:WINDOW#3,levg3%,14,alkug%,15 1 1930 DEFine PROCedure p_sovita_vakioikkuna 1 1910 END DEFine p_perusikkunat 1 1900 PAPER#0,0:CSIZE#0,2,0 1 190 DIM ky%(n%) 1 1890 PAPER#1,0:BORDER#1,2,1:CSIZE#1,2,0:CLS#1 1 1880 WINDOW#0,levg%, 25,alkug%,231 1 1870 WINDOW#1,295,215,alkug%+162,15 1 1860 WINDOW#1,levg%,215,alkug%,15:BORDER#1,2,1 1 1850 DEFine PROCedure p_perusikkunat 1 1830 END DEFine f_etaisyys 1 1820 RETurn ABS(y0%-a-k*x0%)/SQRT(1+k^2) 1 1810 DEFine FuNction f_etaisyys(x0%,y0%,a,k) 1 180 DIM kx%(n%) 1 1790 END DEFine f_lahella 1 1780 RETurn 1:ELSE :RETurn 0:END IF 1 1770 IF piste%>-raja%-4 AND piste%<raja%+4 THEN 1 1760 DEFine FuNction f_lahella(piste%,raja%) 1 1740 END DEFine p_bonus_ilmoitus 1 1730 INK#cl%,5:CURSOR#cl%,48,40:PRINT#cl%,"LINE" 1 1720 CURSOR#cl%,40,10:PRINT#cl%,"BONUS":FLASH#cl%,0 1 1710 CLS#cl%:INK#cl%,6:CSIZE#cl%,3,1:FLASH#cl%,1 1 1700 LOCal cl%:cl%=6 1 1690 DEFine PROCedure p_bonus_ilmoitus 1 1670 END DEFine p_odota_loppu 1 1660 AT 10,5:PRINT FILL$(" ",14) 1 1640 DEFine PROCedure p_odota_loppu 1 1620 END DEFine p_odota_alku 1 1610 PRINT"PLEASE WAIT...":FLASH 0 1 1600 INK 5:AT 10,5:FLASH 1 1 160 DIM mj$(mp),ala$(mp),yla$(mp) 1 1590 DEFine PROCedure p_odota_alku 1 1570 END DEFine p_suora 1 1560 INK 7:LINE x1,y1 TO x2,y2 1 1550 END IF 1 1540 y2=100-origo_y%:x2=(y2-a)/k 1 1530 y1=-origo_y%:x1=(y1-a)/k 1 1510 x2=100-origo_x%:y2=a+k*x2 1 1500 x1=-origo_x%:y1=a+k*x1 1 1490 IF ABS(k)<=1 THEN 1 1480 LOCal x1,x2,y1,y2 1 1470 DEFine PROCedure p_suora(a,k) 1 1450 END DEFine p_piirra_ympyrat 1 1440 END FOR i 1 1430 p_ympyra(kx%(i)),(ky%(i)),(sade%(i)),(arvo%(i)),(0) 1 1420 FOR i=1 TO n% 1 1410 LOCal i 1 1400 DEFine PROCedure p_piirra_ympyrat 1 140 REPeat runko 1 1380 END DEFine p_ympyra 1 1370 CIRCLE ksx%,ksy%,sad%:FILL 0 1 1360 INK vari%(arv%) 1 1350 FILL fll% 1 1340 DEFine PROCedure p_ympyra(ksx%,ksy%,sad%,arv%,fll%) 1 1320 END DEFine p_arvonta 1 1310 END FOR i 1 1300 END FOR j 1 1290 IF vali<sade%(i)+sade%(j)+2 THEN GO TO 1090 1 1280 vali=SQRT(vali) 1 1270 vali=(kx%(i)-kx%(j))^2+(ky%(i)-ky%(j))^2 1 1260 FOR j=1 TO i-1 1 1250 IF i=1 THEN GO TO 1310 1 1230 IF f_lahella((ky%(i)),(sade%(i))) THEN GO TO 1090 1 1220 IF f_lahella((kx%(i)),(sade%(i))) THEN GO TO 1090 1 1200 IF sade%(i)<=0 THEN sade%(i)=2 1 120 p_nimio:RANDOMISE:paras%=0 1 1190 sade%(i)=8-arvo%(i) 1 1180 END SELect 1 1170 =REMAINDER :arvo%(i)=6 1 1160 =23 TO 25:arvo%(i)=5 1 1150 =19 TO 22:arvo%(i)=4 1 1140 =14 TO 18:arvo%(i)=3 1 1130 = 8 TO 13:arvo%(i)=2 1 1120 = 1 TO 7:arvo%(i)=1 1 1110 SELect ON iapu 1 1100 ky%(i)=RND(7-origo_y% TO 93-origo_y%):iapu=i 1 110 DIM ohj$(8),tpvm$(6):ohj$="LINEGAME":tpvm$="101286" 1 1090 kx%(i)=RND(7-origo_x% TO 93-origo_x%) 1 1080 FOR i=1 TO n% 1 1070 LOCal i,j,vali,iapu 1 1060 DEFine PROCedure p_arvonta 1 1040 END DEFine p_akselit 1 1030 END FOR i 1 1020 LINE 0,i TO 2+(i MOD 50=0),i 1 1010 LINE i,0 TO i,2+(i MOD 50=0) 1 1000 FOR i=-100 TO 100 STEP 10 1 100 CLEAR:kokoaika=DATE:mp=36:bon=1 1 1 REMark linegame (c) Prof. Timo Salmi, University of Vaasa, Finland